package factory.impl;

import factory.base.BasePizza;
import factory.base.BasePizzaStore;
import factory.base.PizzaIngredientFactory;
import factory.entity.NyStyleCheesePizza;

/**
 * 纽约制造披萨的商店(工厂)
 * @author yaojianfeng
 */
public class NyStylePizzaStore extends BasePizzaStore {

    public NyStylePizzaStore() {
    }

    /**
     * 获取披萨对象
     *
     * @param pizzaType 披萨类型
     * @return 具体的披萨
     */
    @Override
    public BasePizza creatPizza(String pizzaType) {
      PizzaIngredientFactory  pizzaIngredientFactory = new NyPizzaIngredientFactory();
        if ("cheese".equals(pizzaType)){
            pizza = new NyStyleCheesePizza(pizzaIngredientFactory);
        }else {
            pizza = null;
        }
        return pizza;
    }



}


